import 'dart:convert';

import 'package:get/get.dart';
import 'package:study_demo/api/bean.dart';
import 'package:study_demo/base/BaseController.dart';

import '../../generated/assets.dart';
import '../../util/commond.dart';

class RoleAdminController extends BaseController {
  final roles = <RoleAdmin>[].obs;

  @override
  onInit() async {
    super.onInit();
    var content = await loadAsset(Assets.fileRoleAdmin);
    List<dynamic> roleList =
        json.decode(content).map((e) => RoleAdmin.fromJson(e)).toList();
    roles.assignAll(List<RoleAdmin>.from(roleList));
  }
}
